﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using UcAsp.Net.BLL;
using UcAsp.Net.Model;
namespace UcAsp.Net.Web.Controllers
{
    public class MobileController : Controller
    {
        private ArticlesBLL articles = new ArticlesBLL();
        // GET api/<controller>
        public ActionResult GetMenu()
        {
            List<DefinedCode> list = DefinedCodeBLL.DefinedCodeName("MobileMenu");
            return Json(list, JsonRequestBehavior.AllowGet);
        }

        // GET api/<controller>/5
        public ActionResult GetArticles(int categorieId, int pageIndex)
        {
            int pagecount = 0;
            List<ArticelsViews> list = articles.SelectViews(null, categorieId, 20, pageIndex, out pagecount);
            return Json(list, JsonRequestBehavior.AllowGet);
        }

    }
}